from abc import ABC, abstractmethod

class IFromPlain(ABC):
    def __init__(self, **args):
        pass

    @classmethod
    @abstractmethod
    def from_plain(cls, **args):
        print("IFromPlain")
        return IFromPlain(**args)




import unittest 
class TestFromPlain(unittest.TestCase):
    class Order(IFromPlain):
        def __init__(self, no, name):
            self.__no = no
            self.__name = name
        def no(self):
            return self.__no
        def name(self):
            return self.__name

        def __str__(self):
            return "[no:{},name:{}]".format(self.no(), self.name())

        @classmethod
        def from_plain(cls, **args):
            return cls(args.get("no"), args.get("name"))

    def test_order_from_plain(self):
        self.assertIsNotNone(TestFromPlain.Order.from_plain(no=1, name="name"))

    def test_from_plain(self):
        pass 
        #TODO: raise Exception for create the Abstract IFromPlain
    
